import React,{useState} from 'react';
import {Button} from 'antd';
interface IProps {
  username?: string;
  password: string;
  db: boolean;
}

/*
  没有state
* 组件的类型 React.FC
* */
const FnComponent: React.FC<IProps> = (props) => {
  const [count,setCount] = useState(0);
  return (<div>
    <input onChange={(e)=>{
      // e.target.value
    }}/>
    <Button type={'primary'} onClick={()=>setCount(count-1)}>-</Button>
    {count}
    <Button type={'ghost'} onClick={()=>setCount(count+1)}>+</Button>
    传递过来的模板 : {props.children}
  </div>)
}

export default FnComponent
